package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.domain.Merchants;
import com.ruoyi.common.mapper.MerchantsMapper;
import com.ruoyi.system.service.IMerchantsService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商家信息表，存储所有参与霸王餐活动的商家信息 服务实现类
 * </p>
 *
 * @author jiabao
 * @since 2025-06-24
 */
@Service
public class MerchantsServiceImpl extends ServiceImpl<MerchantsMapper, Merchants> implements IMerchantsService {
    @Override
    public int insertWithPoint(Merchants merchants) {

        return  this.baseMapper.insertWithLocation(merchants);
    }

    @Override
    public List<Merchants> selectMerchantsList(Merchants merchants) {

        return this.getBaseMapper().selectMerchantsList(merchants);
    }

    @Override
    public Merchants selectMerchantsById(Long id) {



        return this.getBaseMapper().selectMerchantsWithLocationById(id);
    }

    @Override
    public int updateMerchants(Merchants merchants) {
        return this.getBaseMapper().updateMerchants(merchants);
    }

    @Override
    public int deleteMerchantsByIds(Long[] ids) {
        return this.getBaseMapper().updateMerchantsStatus(CollectionUtils.toList(ids),1);
    }
}
